<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>扫描二维码填写个人信息</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            text-align: center;
            background-color: #f4f4f4;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            height: 100vh;
            margin: 0;
        }
        h1 {
            margin-top: 20px;
        }
        #qrcode {
            margin-top: 20px;
        }
        button {
            margin-top: 20px;
            padding: 10px 20px;
            font-size: 16px;
            background-color: #007bff;
            color: #fff;
            border: none;
            border-radius: 5px;
            cursor: pointer;
        }
        button:hover {
            background-color: #0056b3;
        }
    </style>
    <script src="https://cdn.bootcss.com/jquery/3.5.1/jquery.min.js"></script>
</head>
<body>
<h1>扫描二维码填写个人信息<br>爱情路漫漫，张家口-小风为您服务</h1>
<div id="qrcode"></div>
<button onclick="callApi()">调用接口</button>
<script src="https://cdn.bootcss.com/qrcodejs/1.0.0/qrcode.min.js"></script>
<script>
    var qrcode = new QRCode(document.getElementById("qrcode"), {
        width : 200,
        height : 200
    });

    // 生成二维码
    var url = "http://62.234.4.118:8888/blind/home"; // 替换成你的Spring Boot项目接口地址
    qrcode.makeCode(url);

    // 调用接口
    function callApi() {
        $.ajax({
            url: url,
            type: "GET",
            success: function(data) {
                window.location.href = "/blind/home"; // 替换成你想要跳转的页面地址
            },
            error: function() {
                alert("接口调用失败");
            }
        });
    }
</script>
</body>
</html>